package com.idata.service.utils;

import com.idata.service.services.HighRiskDisputeService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


@Component
public class HighRiskDisputeUtil implements ApplicationContextAware, InitializingBean {

    private ApplicationContext context;

    private static HighRiskDisputeService highRiskDisputeService;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.context = applicationContext;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        highRiskDisputeService = this.context.getBean(HighRiskDisputeService.class);
    }

    public static boolean isHighRiskDispute(String text) {
        return highRiskDisputeService.isHighRiskDispute(text);
    }
}
